package com.xwy.service.impl;

import com.github.pagehelper.PageHelper;
import com.xwy.dao.SysApplyDao;
import com.xwy.dao.SysDepartmentDao;
import com.xwy.entity.SysDepartment;
import com.xwy.service.DepartmentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class DepartmentServiceImpl implements DepartmentService {

    @Resource
    private SysDepartmentDao sysDepartmentDao;

    @Override
    public List<SysDepartment> findDepartmentAll(int pageNum, int pageSize) {
        //pageNum代表页码值，pageSize代表每页条数
        PageHelper.startPage(pageNum, pageSize);
        List<SysDepartment> departmentAll = sysDepartmentDao.findDepartmentAll();
        return departmentAll;

    }

    @Override
    public SysDepartment getOneA(String depId) {
        SysDepartment sysDepartment = sysDepartmentDao.queryById(depId);
        return sysDepartment;
    }


}
